package com.superzqb.asus.superzqbFragment.superzqbShopQrcode;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.PopupWindow;

import com.superzqb.asus.superzqb.R;
import com.superzqb.asus.superzqbFragment.superzqbShopQrcode.image.ImageFloder;
import com.superzqb.asus.superzqbFragment.superzqbShopQrcode.image.ListviewAdapter;

import java.util.List;


public  class Myalbumlist extends PopupWindow {

	private static final String TAG="CustomMenu";
    private static PopupWindow pop=null;
    private final Activity activity;
    List<ImageFloder> mImageFloders;
    static ListView alist;
    ImageButton left;
    static ListviewAdapter listadapter;
    View view ;
    public Myalbumlist(Activity activity) {
        // TODO Auto-generated constructor stub
        this.activity = activity;
        
    }

   
  

	public PopupWindow getMenu(Context context, int wwidth, List<ImageFloder> mImageFloders, OnClickListener clickListener, OnItemClickListener ClickListener) {
    	this.mImageFloders=mImageFloders;
    	view = activity.getLayoutInflater().inflate(R.layout.dialod_album, null);  // layout_custom_menu菜单的布局文件
        pop = new PopupWindow(view,wwidth/20*9,
                LayoutParams.MATCH_PARENT);
        pop.setBackgroundDrawable(activity.getResources().getDrawable(R.mipmap.pop));// 这句是关键，响应返回键必须的语句
        pop.setAnimationStyle(R.style.AnimationFade);
        pop.setFocusable(true);
        pop.setTouchable(true);
        pop.setOutsideTouchable(true);
//       
        alist = (ListView)view.findViewById(R.id.albumlist);
        left =(ImageButton)view.findViewById(R.id.leftimageBu);
        
        alist.setVerticalScrollBarEnabled(false);
        left.setOnClickListener(clickListener);
        listadapter = new ListviewAdapter(activity, mImageFloders);
        alist.setAdapter(listadapter);

		alist.setOnItemClickListener(ClickListener);
        return pop;
    }

   

    
}
